<template>
  <transition name="bounce">
    <div class="kiko-confirm" v-if="errorTipVisible">
      <div class="bg"></div>
      <div class="kiko-container" :style="{width: width}">
        <div class="content">
          <img class="content-img" src="./assets/tishi.png"/>
          <div class="content-text">{{message}}</div>
          <span class="content-line"></span>
          <a
            class="kiko-btn make-sure"
            @click="close()"
          >确定</a>
        </div>
      </div>
    </div>
  </transition>
</template>

<script type="text/javascript">
  export default {
    name: 'errorTip',
    props: {
      width: {
        type: String,
        default: '250px'
      },
      errorTipVisible: {
        type: Boolean,
        default: false
      },
      message: {
        type: String,
        default: '密码和手机号输入错误'
      }
    },
    data () {
      return {
      }
    },
    methods: {
      close () {
        this.$emit('update:errorTipVisible', false)
      }
    }
  }
</script>

<style type="text/css">
  .bounce-enter-active {
   -webkit-transform: scale(2);
    -moz-transform: scale(2);
    -ms-transform: scale(2);
    transform: scale(2);
    opacity: 0;
    -webkit-transition: all 0.1s;
    -moz-transition: all 0.1s;
    transition: all 0.1s;
  }
  .bounce-leave-active {
    -webkit-transform: scale(2);
    -moz-transform: scale(2);
    -ms-transform: scale(2);
    transform: scale(2);
    opacity: 0;
    -webkit-transition: all 0.1s;
    -moz-transition: all 0.1s;
    transition: all 0.1s;
  }
  .kiko-confirm {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999999;
  }
  .kiko-confirm .bg {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    /*background-color: #FFFFFF;*/
    background-color: #000;
    opacity: 0.1;
    z-index: 99999;
  }
  .kiko-confirm .kiko-container {
    position: fixed;
    display: inline-block;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    z-index: 9999999999999;
  }

  .kiko-confirm .kiko-container .content {
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: #FFFFFF;
  }
  .kiko-confirm .kiko-container .content .content-img {
    width: 60px;
    height: 60px;
    margin-top: 20px;
  }
  .kiko-confirm .kiko-container .content .content-line {
    display: inline-block;
    width: 100%;
    height: 2px;
    background-color: #eaeaea;
  }
  .content-text {
    color: #666666;
    padding: 30px 10px;
  }
  .kiko-confirm .kiko-container .kiko-footer {
    width: 100%;
    padding: 10px;
    background-color: #FFFFFF;
    text-align: right;
    border-top: 1px solid #eee;
  }
  .kiko-btn {
    padding: 5px 15px;
    text-decoration: none !important;
    border-radius: 2px;
    margin: 6px 6px 0 6px;
  }
  .kiko-btn:hover {
    text-decoration:  none !important;
  }
  .kiko-btn:active {
    text-decoration:  none !important;
  }
  .kiko-btn.make-sure {
    color: #f3a13a;
    text-align: center;
    display: inline-block;
    width: 100%;
  }
  .kiko-btn.cancel {
    background-color: #BBB5B5;
    color: #fff;
  }
</style>
